import request from '@/utils/request'

export function addBank(Bank) {
  return request({
    url: '/bank/append',
    method: 'post',
    data: {
      bankName: Bank.bankName,
      bankImg: Bank.bankImg,
      bankInfo: Bank.bankInfo
    }
  })
}

export function deleteById(id) {
  return request({
    url: '/bank/remover',
    method: 'get',
    params: {
      id: id
    }
  })
}

export function updateBank(Bank) {
  return request({
    url: '/bank/update',
    method: 'get',
    params: {
      bankId: Bank.bankId,
      bankName: Bank.bankName,
      bankImg: Bank.bankImg,
      bankInfo: Bank.bankInfo
    }
  })
}

export function getAllBank() {
  return request({
    url: '/bank/all',
    method: 'get'
  })
}

export function getBankById(id) {
  return request({
    url: '/bank/',
    method: 'get',
    params: {
      id: id
    }
  })
}

export function mohuSearch(str) {
  return request({
    url: '/bank/search1',
    method: 'get',
    params: {
      str: str
    }
  })
}
